import React from 'react';
import ReactDOM from 'react-dom';
import './index.less';
import App from './App';
import reportWebVitals from './reportWebVitals';
import { Provider } from 'react-redux';
import { BrowserRouter } from 'react-router-dom';
import store from './util/storeBase';
import './sass/base.scss';
import zhCN from 'antd/lib/locale/zh_CN'; // https://ant.design/docs/react/i18n-cn
import { ConfigProvider } from 'antd';

const requireAll = (requireContext: any) => requireContext.keys().map(requireContext);
const svgs = (require as any).context('./icon', false, /\.svg$/);
requireAll(svgs);

ReactDOM.render(
	<Provider store={store}>
		<BrowserRouter>
			<ConfigProvider locale={zhCN}>
				<App store={store} />
			</ConfigProvider>
		</BrowserRouter>
	</Provider>,
	document.getElementById('root'),
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
